<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<style>
<!--
.notification_box  li {
	height: 30px; padding: 0px; background: #f8f8f8; float: left; width: 90px; margin-left: 10px; position: relative; border: 1px solid #ccc;
}

.notification_box .firstli {
	position: absolute; min-width: 50px; left: 3px; line-height: 31px; text-align: center;
}

.notification_box .secli {
	color: #fff; position: absolute; right: 0; width: 30px; background: #48ac2e; height: 30px; text-align: center; line-height: 31px; position: absolute;
}

html {
	overflow: auto
}
-->
</style>



<isperp:grid url="kpi/incident/dataList?fromType=${fromType}&key=${key }&value=${value }&1=1${url }" actionsWidth="50"
	rowNum="10" gridId="incidentGrid" sortname="create_date"
	sortorder="desc" autowidth="true"
	ondbClickRowEvent="incidentGrid.view(rowid);" autoReloadGrid="false"
	autoReloadTreeMenu="incidentMenu" cusViewUrl="incident/incident/view"
	advanceSearch="true"
	keywordFields="code,title"
	keywordTitle="输入编号/标题">

	<jsp:attribute name="toolbar">
	<isperp:treeMenu id="incidentMenu" targetGridId="incidentGrid">
		<isperp:callback onClick="incidentMenuTree_onNodeClick"
				onAsyncSuccess="incidentMenuTree_onNodeClickFirst();">
		</isperp:callback>
	</isperp:treeMenu>
	<isperp:toolbar id="userToolbar">
	 
	</isperp:toolbar>
	</jsp:attribute>

	<jsp:attribute name="searchbar">
	 
	<table class="search-table">
		<tbody>
			<tr>
				<td class="td1">编号：</td>
				<td class="td2"><input type="text" field="code" op="cn">
				</td>
				<td class="td1">关键字：</td>
				<td class="td2"><input type="text" field="title,description"
						op="cn">
				</td>
				<td class="td1">事件分类：</td>
				<td class="td2"><input type="hidden" id="icdCategoryId"
						field="icd_category_name" op="cn" /> <isperp:treeSelector
							url="incident/category/getTree" id="icdCategorySelector"
							name="text" displayValue="" valueColumn="text"
							valueControlId="icdCategoryId"></isperp:treeSelector>
				</td>
			</tr>
			<tr>
			
				<td class="td1">报障人：</td>
				<td class="td2"><input type="text" field="cus_user_name"
						op="cn">
				</td>
				<td class="td1">SLA状态：</td>
				<td class="td2"><input type="radio" field="sla_status" op="in"
						name="group1" value="" checked />全部 <input type="radio"
						field="sla_status" op="eq" name="group1" value="0" />正常<input
						type="radio" field="sla_status" op="eq" name="group1" value="1" />异常
				</td>
				<td class="td1">处理状态：</td>
				<td class="td2">
				<isperp:dictSelector id="status" field="status" 
							multiple="true" typeCode="INCIDENT_STATUS" op="cn"></isperp:dictSelector>
			 
				</td>
			</tr>

			<tr>
				<td class="td1">登记者：</td>
				<td class="td2"><input type="text" field="creator,creator_name"
						op="cn">

					</td>
				<td class="td1">解决者：</td>
				<td class="td2"><input type="text"
						field="solver_id,solver_name" op="cn">
				
					</td>
				<td class="td1">关闭者：</td>
				<td class="td2"><input type="text"
						field="closer_id,closer_name" op="cn">
					</td>
			</tr>

			<tr>
				<td class="td1">优先级：</td>
				<td class="td2">
				
				<isperp:dictSelector id="priority" field="priority" op="in"
							hasEmptyValue="true" multiple="true" typeCode="INCIDENT_PRIORITY"></isperp:dictSelector>
				
					</td>
				<td class="td1">解决方式：</td>
				<td class="td2">
				<isperp:dictSelector id="solution_way" field="solution_way" op="in"
							hasEmptyValue="true" multiple="true"
							typeCode="INCIDENT_SOLUTIONWAY"></isperp:dictSelector>
				 
					</td>
				<td class="td1">关闭方式：</td>
				<td class="td2">
				
				<isperp:dictSelector id="close_code" field="close_code" op="in"
							hasEmptyValue="true" multiple="true"
							typeCode="INCIDENT_CLOSECODE"></isperp:dictSelector>
				
					</td>
			</tr>
			<tr>
				<td class="td1">报障时间：</td>
				<td class="td2"><input id="registerDateStart" type="date"
						field="create_date" op="gt" style="width: 68px" />~<input
						id="registerDateEnd" type="date" field="create_date" op="lt"
						style="width: 68px" />
					</td>
				<td class="td1">解决时间：</td>
				<td class="td2"><input id="solveDateStart" type="date"
						field="solved_date" op="gt" style="width: 68px" />~<input
						id="solveDateEnd" name="solveDateEnd" type="date"
						field="solved_date" op="lt" style="width: 68px" />
					</td>
				<td class="td1">关闭时间：</td>
				<td class="td2"><input id="closeDateStart" type="date"
						field="closed_date" op="gt" style="width: 68px" />~<input
						id="closeDateEnd" name="closeDateEnd" type="date"
						field="closed_date" op="lt" style="width: 68px" />
					</td>
			</tr>
			<tr>
			 	<td class="td1">报障部门：</td>
				<td class="td2"><input type="hidden" id="departmentPath"
						field="department_path" op="cn" /> <isperp:treeSelector
							url="app/department/getTree" id="departmentPathSelector"
							name="departmentPathName" displayValue=""
							valueControlId="departmentPath">
						</isperp:treeSelector>
				</td>  <td class="td1">是否关闭：</td>
				<td class="td2" colspan="3"><input type="radio" field="status"
						id="rs1" op="cn" name="gstatus" value="" checked="checked" /><label
						for="rs1">全部</label><input type="radio" field="status" op="eq"
						name="gstatus" value="已关闭" id="rs2" /><label for="rs2">已关闭</label><input
						type="radio" field="status" op="ne" name="gstatus" value="已关闭"
						id="rs3" /><label for="rs3">未关闭</label>
						
				</td>
			</tr>
		</tbody>
	</table>
	</table>
	</jsp:attribute>
	<jsp:body>
	<isperp:column name="id" title="" hidden="true">
	</isperp:column>
	<isperp:column name="sla_status" title="" hidden="true"></isperp:column>
	<isperp:column name="priority_name" title="" width="40"
			isFormatterFun="true" formatter="return statusFormatter(rowObject);">
	</isperp:column>	

	<isperp:column name="code" title="编号" width="70" showInHead="true"
			fixed="true">
	</isperp:column>
	<isperp:column name="ci_code" title="资产编号" showInHead="false"
			width="80"></isperp:column>
	<isperp:column name="incident_type" showInHead="false" title="性质"
			width="60"></isperp:column>
 
	
	<isperp:column name="happen_time" title="发生时间" showInHead="false"
			width="80">
	</isperp:column>
	
	
	<isperp:column name="title" title="标题" width="150" showInHead="true">
	</isperp:column>
	
	<isperp:column name="solver_department_path" title="解决部门" width="150" showInHead="true">
	</isperp:column>
	<isperp:column name="icd_category_name" title="所属系统" width="100"
			showInHead="true">
	</isperp:column>
	
	<isperp:column name="cus_user_name" title="申报人" showInHead="true"
			width="65">
	</isperp:column>
	
	<isperp:column name="create_date" showInHead="true" title="创建时间"
			width="120">
	</isperp:column>
 
	<isperp:column name="assign_date" title="分派时间" showInHead="false"
			width="80">
	</isperp:column>
 
	<isperp:column name="source" showInHead="false" title="来源" width="60"></isperp:column>
 
	<isperp:column name="assigner_name" title="受理人" width="65"
			showInHead="true">
	</isperp:column>
	<isperp:column name="supporter_name" title="工程师" width="65"
			showInHead="true">
	</isperp:column> 
	<isperp:column name="status" title="状态" width="65" showInHead="true">
	</isperp:column>
	  
	<isperp:column name="solver_submit_time" title="二线关单时间" width="120"
			showInHead="true">
	</isperp:column>
	<isperp:column name="solved_date" title="解决时间" width="110"
			showInHead="false">
	</isperp:column>
    <isperp:column name="description" title="描述" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="faultlocation_name" title="故障定位"
			showInHead="false" width="80">
	</isperp:column>
	<isperp:column name="reason_analyze" title="原因分析" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="solution" title="解决方案" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="handle_process" title="处理过程" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="deadline" title="最终期限" showInHead="false"
			width="80">
	</isperp:column>
	
	<isperp:column name="response_date" title="二线接单时间" showInHead="false"
			width="80">
	</isperp:column>
    
	<isperp:column name="linkman_name" title="联系人" showInHead="false"
			width="60">
	</isperp:column>
	<isperp:column name="linkman_phone" title="联系人电话" showInHead="false"
			width="60">
	</isperp:column>
	
	<isperp:column name="urgency_name" title="紧急度" showInHead="false"
			width="50">
	</isperp:column>
	<isperp:column name="effect_name" title="影响度" showInHead="false"
			width="50">
	</isperp:column>
 

	<isperp:column name="solution_way" title="解决方式" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="solution_stage" title="解决阶段" showInHead="false"
			width="80">
	</isperp:column>
 
	<isperp:column name="satisfaction" title="满意度" showInHead="false"
			width="80">
	</isperp:column>
 
	<isperp:column name="are_feedback" title="是否客户评价" showInHead="false"
			width="50">
	</isperp:column>
	<isperp:column name="customer_opinion" title="客户意见" showInHead="false"
			width="80">
	</isperp:column>	
	<isperp:column name="closed_date" title="关闭时间" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="closer_name" title="关闭者" showInHead="false"
			width="80">
	</isperp:column>
	<isperp:column name="close_code" title="关闭码" showInHead="false"
			width="50">
	</isperp:column>
	</jsp:body>
</isperp:grid>

<script type="text/javascript">
	 
	
	function statusFormatter(rowObject) {
		var p = 0, html = "", title = "";
		if (rowObject.priority_name != null) {

			switch (rowObject.priority_name) {
			case "一级":
				p = 1;
				break;
			case "二级":
				p = 2;
				break;
			case "三级":
				p = 3;
				break;
			case "四级":
				p = 4;
				break;
			case "五级":
				p = 5;
				break;
			}
			title = "优先级：" + p + "级";
		} else {
			title = "未确定优先级";
		}

		html = "<img title='"+title+"' src='img/incident/p"+p+".png'>";
		if (rowObject.sla_status == 1) {

			html = html + "&nbsp;<img title='SLA：异常'  src='img/incident/sla_unusual.png'>";
		}
		return html + "&nbsp;<a id='msg_" + rowObject.id + "' href=\"javascript:openRelationMessage('" + rowObject.id + "')\" class=''></a>";
	}

	function openRelationMessage(id) {

		isperp.openDialog({
			title : "查看消息",
			contentUrl : "app/message/relationMessageView?all=1&sourceId=" + id
		});
	}
	 
	 
</script>


<isperp:buttonList>
</isperp:buttonList>